package com.lzk.validator;

import com.jfinal.core.Controller;
import com.jfinal.kit.Ret;
import com.jfinal.validate.Validator;

public class RoomValidator extends Validator{

	@Override
	protected void validate(Controller c) {
		setRet(Ret.fail());
		if ("/front/room/add".equals(getActionKey())) {
			validateRequired("roomName", "msg", "房间名不得为空");
			validateRequired("maxCount", "msg", "最大数量不得为空");
		}
		
	}

	@Override
	protected void handleError(Controller c) {
		c.renderJson(getRet());
		
	}

}
